package com.monkeyboy.service.rockettransaction;

import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * s
 *
 * @Author Gavin
 * @date 2020.08.22 11:21
 */
@Component
@RocketMQMessageListener(topic = "tx_order_topic", consumeMode = ConsumeMode.CONCURRENTLY, consumerGroup = "order")
public class OrderTransactionConsumer implements RocketMQListener<MessageExt> {

    @Override
    public void onMessage(MessageExt msg) {
        System.out.println("消费者接受事务消息成功------------");
        System.out.println(new String(msg.getBody()));
    }
}
